//
//  sNetworkTool.swift
//  weibo
//
//  Created by Qing on 2018/5/7.
//  Copyright © 2018年 成哥哥. All rights reserved.
//

import UIKit

class sNetworkTool: NSObject {
    
    static let shared = sNetworkTool()
    
    func get(url: String, succes: @escaping (_ data: String) ->() , failure: (_ error: Error) -> () )  {
        
        let url = URL(string: url)
        let session = URLSession.shared
        
        let dataTask = session.dataTask(with: url!) { (data, _, error) in
            
            
            let result = String(data: data!, encoding: .utf8)
            
            succes(result!)
            
        }
        
    }

}
